package com.yuyou.tas.admin.comm;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;

import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.yuyou.tas.admin.mapper.AuthOrganizationMapper;
import com.yuyou.tas.util.bean.LoginRedisObj;

@Service
public class LoginRedisService {
	
	@Autowired
	private StringRedisTemplate stringRedisTemplate;
	
    public LoginRedisObj getUserObj(String userId) {
        String accessToken=stringRedisTemplate.opsForValue().get(userId);
        String jsonObj=stringRedisTemplate.opsForValue().get(accessToken);
        LoginRedisObj obj=JSONObject.parseObject(jsonObj, new TypeReference<LoginRedisObj>() {});       
        return obj;
    }

}